/*
 * MMAGridList.java
 *
 * Created on November 26, 2004, 6:29 PM
 */

package edu.temple.GUS.MMA.DataTypes;

import java.util.ArrayList;
/**
 *
 * @author  jeffleon
 */
public class MMAGridList {
    
    private ArrayList list;
    
    /** Creates a new instance of MMAGridList */
    public MMAGridList() { list = new ArrayList(); }
    
    /* Appends the specified MMAGrid to the end of the list. */
    /* Return true if successful otherwise false */
    public boolean add(MMAGrid grid) {return list.add(grid);}
    
    /* Inserts a MMAGrid at the specified position in this list. */
    public void add(int index, MMAGrid grid) throws IndexOutOfBoundsException {list.add(index, grid);}
    
    /* Removes all of the grids from this list. */
    public void clear() {list.clear();}
    
    /* Returns a MMAGrid at the specified position in this list. */
    public MMAGrid get(int index) { return (MMAGrid)list.get(index);}
     
    /* Tests if this list has no element. */
    public boolean isEmpty() { return list.isEmpty();}
     
    /* Removes an element at the specified position in this list. */
    public MMAGrid remove(int index) { return (MMAGrid)list.remove(index);}
    
    /* Returns the number of elements in this list. */
    public int size() { return list.size();}
}
